package com.srzk.youthleagueback.controller;


import com.srzk.youthleagueback.pojo.Lecture;
import com.srzk.youthleagueback.pojo.Meeting;
import com.srzk.youthleagueback.results.Result;
import com.srzk.youthleagueback.service.LectureService;
import com.srzk.youthleagueback.service.MeetingService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/admin/part2")
public class AdminPart2 {
    @Autowired
    MeetingService meetingService;
    @GetMapping("/gradeMeetingMinutes")
    public Result<Map<String,Object>> getGradeMeeting(@Param("grade")String grade, @Param("year")String year, @Param("type")int type){
        return meetingService.getGradeList(grade,year,type);
    }
    @GetMapping("/historyMeetingMinutes")
    public Result<Map<String,Object>> getHistoryMeeting(@Param("user")String user, @Param("type")int type){
        return meetingService.getHistoryList(user,type);
    }

    @Autowired
    LectureService lectureService;
    @GetMapping("/gradeLecture")
    public Result<Map<String,Object>> getGradeLecture(@Param("grade")String grade, @Param("year")String year){
        return lectureService.getGradeList(grade,year);
    }
    @GetMapping("/historyLecture")
    public Result<Map<String,Object>> getHistoryLecture(@Param("user")String user){
        return lectureService.getHistoryList(user);
    }
}
